<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page language="java" import="com.br.dao.EmpresaDao"%>    
<%@ page language="java" import="com.br.model.Empresa"%>
<%@ page language="java" import="com.br.utilitarios.funcoes"%>
<%@ page language="java" import="java.util.List"%>
<%@ page language="java" import="java.util.ArrayList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="shortcut icon" href="resources/if.ico"> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>GesDoc - Gestao Documental</title>
<style type="text/css"> 
@import url(styles.css)
</style>
</head>
<body>
<%
 String vFantasia = request.getParameter("txtFantasia");
 String vEmpresa  = request.getParameter("txtEmpresa");
 
 vFantasia = vFantasia.toUpperCase(); 
 vEmpresa  = vEmpresa.toUpperCase();
 
 Empresa emp = new Empresa();
 emp.setNOM_EMPRESA(vEmpresa);
 emp.setNOM_FANTASIA(vFantasia);
 EmpresaDao empDao = new EmpresaDao();
 try{
	emp = empDao.gravar(emp);
 %>  
     <div id="centrallogin">
	 <p align="center"><img heigth="110%" width="110%" src="resources/gesdoc02.png" ></p>
	 <p align="center"><strong>&nbsp;&nbsp; Empresa cadastrada com sucesso !</strong>
 	 <h2><center><strong><a HREF="index.jsp">Voltar</a></strong></center></h2></p>
 	</div>
 <% 	
 }catch(Exception e){
	 e.printStackTrace();
 %>  
     <div id="centrallogin">
	 <p align="center"><img heigth="110%" width="110%" src="resources/gesdoc02.png" ></p>
	 <p align="center"><strong>&nbsp;&nbsp; Erro ao salvar : Erro ao salvar Empresa</strong>
 	 <h2><center><strong><a HREF="index.jsp">Voltar</a></strong></center></h2></p>
 	</div>
 <%	 
 }
 %>
 </div>
</body>
</html>